package com.atguigu.java3;

public class Test {
		public static void main(String[] args) {
			PersonTest1 p = new PersonTest1();
			PersonTest1 p1 = new PersonTest1("Tom");
			System.out.println(p1.name);
			
			p.eat();
		}
}

class PersonTest1{
		//属性
		String name;
		int age;
		
		//构造器
		public PersonTest1(){
				System.out.println("PersonTest1.....");
		}
		
		public PersonTest1(String n){
				name = n;
		}
		
		public PersonTest1(String n, int a){
			name = n;
			age = a;
		}
		
		//方法
		public void eat(){
				System.out.println("人吃饭");
		}
		
		public void studyt(){
			System.out.println("人学习");
		}
}
